<template>
	<view class="c-page">
		
		<view class="hzuo-bg">
			<image src="https://beluga-s3.oss-cn-hangzhou.aliyuncs.com/xdl-bucket/hzuo.png"></image>
		</view>
		
		<view class="hzuo-card">
			<view class="hzuo-item"  v-for="(item, index) in itemList" :key="index" :data-id="index">
				<view class="hzuo-img">
					<image @click="previewImage(item.wxEwm)" :src="item.wxEwm"></image>
				</view>
				<view class="hzuo-info">
					<view class="hzuo-tag">{{item.business}}</view>
					<view class="hzuo-userinfo">
					<view>{{item.name}}</view>
					<view @click="callphone(item)">{{item.contact}}</view>
					</view>
				</view>
			</view>
			
		</view>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				itemList:[]
			}
		},
		onLoad() {
			this.getBusiness();
		},
		methods: {
			previewImage(v){
				uni.previewImage({
					current:v,
					urls: [v]
				});
				
			},
			getBusiness(){
				this.$Request.get(this.$api.business.getBusiness).then(res => {
					if (res.code === 20000 && res.data != null) {
						this.itemList = res.data;
					}
				})
			},
			callphone(i){
				uni.makePhoneCall({
					phoneNumber: i.contact,
				});
				
			}
			
		}
	}
	
	
	
	
	
	
</script>

<style lang="scss">
	
	body {
		margin: 0;
		padding: 0;
		background: #93c4cc !important;
	}
	
	.c-page,
	uni-page-wrapper,
	page {
		background: #93c4cc !important;
		font-family: PingFang SC;
	}
	
	.hzuo-bg{
		image{
			width: 100%;
		}
	}
	
	.hzuo-card{
			
		.hzuo-item{
			margin: 20rpx 20rpx;
			background-color: #ffffff;
			border-radius: 10rpx;
			display: flex;
			align-items: center;
			padding: 20rpx;
			.hzuo-img{
				display: flex;
				align-items: center;
				margin: 0 10rpx;
				image{
					width: 160rpx;
					height: 160rpx;
				}
			}
			.hzuo-info{
				font-size: 28rpx;
				.hzuo-tag{
					display: flex;
					border-radius: 20rpx;
					width: 120rpx;
					font-size: 25rpx;
					justify-content: center;
					color: #ffffff;
					background-color: #E96642;
				}
				.hzuo-userinfo{
					margin-left: 10rpx;
					font-size: 28rpx;
					width: 100%;
					view{
						width: 100%;
						font-weight: bold;
						margin-top: 8rpx;
					}
				}
			}
		}
	}
	
	
</style>
